#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main() {
	int i, j, r, n, c;
	double s, d;
	scanf("%d", &r);
	for (i = 0; i < r; i++) {
		scanf("%d", &n);
		s = 0.0;
		while (n--) {
			c = 1;
			for (j = n + 1; j > 0; j--) {
				c = c * j;
			}
			d = 1.0 / c;
			s = s + d;
		}
		printf("%.4lf\n", s);
	}

	return 0;
}
//1088